<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="./../templates/StakeholderPortalTemplate.xhtml">

    <ui:define name="content"> 
        <h:form>  

            <p:dataTable var="allFandB" value="#{reservationManagerBean.allFandB}" paginator="true" rows="15"  
                         selection="#{reservationManagerBean.selectedReservation}" selectionMode="single"  
                         onRowSelectUpdate="display" onRowSelectComplete="reservationDialog.show()">  

                <f:facet name="header">  
                    List of Reservation  
                </f:facet>  

                <p:column sortBy="#{allFandB.tourist.tourist.firstName}" filterBy="#{allFandB.tourist.tourist.firstName}" filterMatchMode="contains">  
                    <f:facet name="header">  
                        <h:outputText value="First Name" />  
                    </f:facet>  
                    <h:outputText value="#{allFandB.tourist.tourist.firstName}" />  
                </p:column>  

                <p:column sortBy="#{allFandB.tourist.tourist.lastName}" filterBy="#{allFandB.tourist.tourist.lastName}" filterMatchMode="contains">  
                    <f:facet name="header">  
                        <h:outputText value="Last Name" />  
                    </f:facet>  
                    <h:outputText value="#{allFandB.tourist.tourist.lastName}" />  
                </p:column> 

                <p:column sortBy="#{allFandB.dateReserved}" filterBy="#{allFandB.dateReserved}" filterMatchMode="contains">  
                    <f:facet name="header">  
                        <h:outputText value="Date Reserved" />  
                    </f:facet>  
                    <h:outputText value="#{allFandB.dateReserved}" />  
                </p:column>  

                <p:column sortBy="#{allFandB.timeBegin}" filterBy="#{allFandB.timeBegin}" filterMatchMode="contains">  
                    <f:facet name="header">  
                        <h:outputText value="Time Begin" />  
                    </f:facet>  
                    <h:outputText value="#{allFandB.timeBegin}" />  
                </p:column>  

                <p:column sortBy="#{allFandB.timeEnd}" filterBy="#{allFandB.timeEnd}" filterMatchMode="contains">  
                    <f:facet name="header">  
                        <h:outputText value="Time End" />  
                    </f:facet>  
                    <h:outputText value="#{allFandB.timeEnd}" />  
                </p:column> 

                <p:column sortBy="#{allFandB.status}" filterBy="#{allFandB.status}" filterMatchMode="contains">  
                    <f:facet name="header">  
                        <h:outputText value="Customer Status" />  
                    </f:facet>  
                    <h:outputText value="#{allFandB.status}" />  
                </p:column> 

                <p:column sortBy="#{allFandB.confirmation}" filterBy="#{allFandB.confirmation}" filterMatchMode="contains">  
                    <f:facet name="header">  
                        <h:outputText value="Reservation Confirmation" />  
                    </f:facet>  
                    <h:outputText value="#{allFandB.confirmation}" />  
                </p:column> 

            </p:dataTable>  

            <p:dialog header="Reservation Detail" widgetVar="reservationDialog" resizable="false"  
                      width="600" showEffect="explode" hideEffect="explode">  

                <h:panelGrid id="display" columns="2" cellpadding="10">  

                    <h:outputText value="Customer Name:" />  
                    <h:outputText value="#{reservationManagerBean.selectedReservation.tourist.tourist.firstName}" />

                    <h:outputText value="Customer Name:" />  
                    <h:outputText value="#{reservationManagerBean.selectedReservation.tourist.tourist.lastName}" />  

                    <h:outputText value="Reservation ID" />  
                    <h:outputText value="#{reservationManagerBean.selectedReservation.id}" />  

                    <h:outputText value="Customer Status:" />  
                    <h:outputText value="#{reservationManagerBean.selectedReservation.status}" />  

                    <h:outputText value="Reservation Confirmation:" />  
                    <h:outputText value="#{reservationManagerBean.selectedReservation.confirmation}" />  

                    <h:outputText value="Deposite:" />  
                    <h:outputText value="#{reservationManagerBean.selectedReservation.deposit}" />  

                    <h:outputText value="Special Request:" />  
                    <h:outputText value="#{reservationManagerBean.selectedReservation.specialRequest}" />  

                    <h:outputText value="Paid or Not:" />  
                    <h:outputText value="#{reservationManagerBean.selectedReservation.paid}" />  

                    <h:outputText value="Date Reserved:" />  
                    <h:outputText value="#{reservationManagerBean.selectedReservation.dateReserved}" /> 

                    <h:outputText value="Time Begin:" />  
                    <h:outputText value="#{reservationManagerBean.selectedReservation.timeBegin}" />  

                    <h:outputText value="Time End:" />  
                    <h:outputText value="#{reservationManagerBean.selectedReservation.timeEnd}" />  

                    <h:outputText value="Number of People:" />  
                    <h:outputText value="#{reservationManagerBean.selectedReservation.noOfPeople}" />  
                </h:panelGrid>  
            </p:dialog>  
        </h:form> 
    </ui:define>
</ui:composition>
